package com.baizhi.service.impl;

import com.baizhi.dao.AudioDao;
import com.baizhi.entity.Audio;
import com.baizhi.service.AudioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AudioServiceImpl implements AudioService {
    @Autowired(required = false)
    private AudioDao audioDao;

    @Override
    public Map selectAll(int page, int limit, String audioName) {
        int offset=(page-1)*limit;
        List<Audio> list=audioDao.selectAll(offset,limit);
        int count=audioDao.selectCount(audioName);
        Map map=new HashMap();
        map.put("data",list);
        map.put("count",count);
        map.put("code",0);
        map.put("msg","");
        return map;
    }
}
